// GTGE API
// Java Foundation Classes (JFC)
import java.awt.Dimension;
import java.awt.Graphics2D;

import replay.Replay;

import com.golden.gamedev.GameEngine;
import com.golden.gamedev.GameLoader;
import com.golden.gamedev.GameObject;

public class MyBallGame extends GameEngine{
	private int prevGameID;
	private GameObject prevGame;
	private boolean isResume;
	public void initResources() {
		isResume = false;
	}

	public void update(long elapsedTime) {
		
	}

	public void render(Graphics2D g) {
		
	}
	public void setPrevGameID(int ID){
		prevGameID = ID;
	}
	public void setPrevGame(GameObject game){
		prevGame = game;
	}
	public GameObject getPrevGame(){
		return prevGame;
	}
	public static void main(String[] args) {
		GameLoader game = new GameLoader();
		game.setup(new MyBallGame(), new Dimension(640,480), false);
		game.start();
	}
	public void setResume(boolean isItResume){
		isResume = isItResume;
	}
	@Override
	public GameObject getGame(int ID) {
		//TODO: use reflection so that every time I add a level I have to keep increasing this switch case tree.
		switch (ID){
		case 0: return new TitleScreen(this);
		case 1: return new Level1(this, isResume);
		case 2: return new Level2(this, isResume);
		case 3: return new WinScreen(this);
		case 4: return new LoserScreen(this, prevGameID);
		case 5: return new ReplayLevel(this, ((AbstractLevel)prevGame).getTable(), prevGameID);
		default: return new TitleScreen(this);
		}
	}

}

